package com.bwie.redkids;

import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;

import com.bwie.redkids.utils.QrUtils;
import com.google.zxing.WriterException;

/**
 * 
 * @author
 *
 */
public class AboutUsActivity extends Activity implements OnClickListener {
	private ImageView mImage;
	private Button about_us_back;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_about_us);
		mImage = (ImageView) findViewById(R.id.ima_about_us);
		about_us_back = (Button) findViewById(R.id.about_us_back);
		about_us_back.setOnClickListener(this);
		try {
			Bitmap bitmap = QrUtils.createQRCode("http://www.baidu.com", 300);
			mImage.setImageBitmap(bitmap);
		} catch (WriterException e) {
			e.printStackTrace();
		}
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.about_us, menu);
		return true;
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.about_us_back:
			AboutUsActivity.this.finish();
			break;

		default:
			break;
		}
	}

}
